import config from "@/config"
import http from "@/utils/request"

export default {
    order: {
        add: {
            url: `${config.API_URL}/main/om/order/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        generateOrderNo: {
            url: `${config.API_URL}/main/om/order/generateOrderNo`,
            name: "生成合同号",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/om/order/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/om/order/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        update: {
            url: `${config.API_URL}/main/om/order/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        productCategoryTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "类别树状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        exportExcelTemplateList: {
            url: `${config.API_URL}/main/om/order/exportExcelTemplateList`,
            name: "excel列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        select: {
            query: {
                url: `${config.API_URL}/core/reportCoreService/query`,
                name: "获取查询报表",
                post: async function (data, config = {}) {
                    return await http.post(this.url, data, config);
                }
            }
        },


    },
    poOrder:{
        add: {
            url: `${config.API_URL}/main/po/order/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        generatePoOrderNo: {
            url: `${config.API_URL}/main/po/order/generatePoOrderNo`,
            name: "生成采购单号",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/po/order/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/po/order/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        update: {
            url: `${config.API_URL}/main/po/order/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
    shippingOrder:{
        add: {
            url: `${config.API_URL}/main/om/shippingOrder/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        generatePoOrderNo: {
            url: `${config.API_URL}/core/meta/commonOperate/generateBillNumber`,
            name: "生成采购单号",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/om/shippingOrder/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/om/shippingOrder/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        update: {
            url: `${config.API_URL}/main/om/shippingOrder/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    }
}